main:
	;; MUL
	MOV RCX, 0x20000002
	MOV RAX, 0x1122334455667788
	MOV RDX, RAX
	MOV RAX, 0x1122334400000020
	MUL ECX
	CMP RAX, 0x40
	JNZ bad
	CMP RDX, 0x4
	JNZ bad

	;; IMUL
	MOV RCX, 0xFFFFFFF2
	MOV RAX, 0x1122334455667788
	MOV RDX, RAX
	MOV RAX, 0x1122334400000020
	IMUL ECX
	MOV ESI, 0xFFFFFE40
	CMP RAX, RSI
	JNZ bad
	MOV ESI 0xFFFFFFFF
	CMP RDX, RSI
	JNZ bad

	;; DIV
	MOV RAX, 0x1122334400000002
	MOV RCX, RAX
	MOV RAX, 0x1122334400000000
	MOV RDX, RAX
	MOV RAX, 0x1122334440000003
	DIV ECX
	CMP RAX, 0x20000001
	JNZ bad
	CMP RDX, 0x1
	JNZ bad

	;; IDIV
	MOV RAX, 0x11223344FFFFFFF2
	MOV RCX, RAX
	MOV RAX, 0x11223344FFFFFFFF
	MOV RDX, RAX
	MOV RAX, 0x11223344FFFFFFF2
	IDIV ECX
	CMP RAX, 0x1
	JNZ bad
	CMP RDX, 0x0
	JNZ bad


	RET

bad:
	INT 0x3

